-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation: Refactor and simplify setup state. #36375
Conversation
Size Change: +26 B (0%) Total Size: 1.09 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good improvement! I love that the block name is no longer invisible in the narrow view. Just a couple minor suggestions below.
className: 'wp-block-navigation-placeholder__actions__dropdown', | ||
}; | ||
return ( | ||
<DropdownMenu | ||
text={ __( 'Select existing menu' ) } | ||
icon={ chevronDown } | ||
text={ __( 'Existing menu' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we keep "Select existing menu"? My fear is that "Existing menu" is a bit too cryptic. The other buttons are clearer in their intent with "Add...", "Create..." etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking at it yesterday, and wondered if it could be shortened to just 'Select menu'.
border: 0; | ||
min-height: $border-width; | ||
min-width: $border-width; | ||
background-color: $gray-900; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking this could just be a border-left: 1px solid $gray-900
, and if we override the inherited border-bottom
we won't even need to set it to display: none
in the vertical layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recognize the rules here are a bit creative, but I actually wrote them this way in hopes that I could make them work for both vertical and horizontal cases, so that there was a reason to add these to the Placeholder component directly. It technically worked:
But it is a bit noisy and awkward in the vertical orientation.
I think for now I'll remove the rules from the placeholder component and keep them only for the navigation block.
ef0b9a9
to
ba37b76
Compare
ba37b76
to
c024a35
Compare
* Navigation: Refactor and simplify setup state. * Address feedback.
Removing the backport label as this was backported in WordPress/wordpress-develop#1883. |
My bad, thank you! |
Description
The navigation block setup state has a lot of complexity, both technically and visually. This PR simplifies things in light of recent refactors to the flex properties of it. Before:
After:
The addition of the primary button style was in hopes of making it clearer items inside were clickable. In effect it has primarily worked to add complexity and noise. This PR attempts at segmenting the controls inside to aid readibility, with a simpler separated design.
This PR also starts work on the vertical version, which at the moment is only seen in narrow contexts:
More work is needed here, including removing the old
is-vertical
classes, but I omitted that to keep the PR small. Theoretically though, it should be possible to inherit the orientation even in the placeholder, so that's something to look at in the followup.Another step on the journey could be to get rid of the gray placeholders blobs:
Finally the blobs are a great deal of CSS complexity that falls apart in a few ways in the layout, and are causing layout shifts, for example as shown here:
So I'll explore that separately, but this is a first step on the path.
How has this been tested?
Insert a navigation block and select it. Try it also in a narrow viewport, or inside a thin column.
Checklist:
*.native.js
files for terms that need renaming or removal).